package ltd.followkba.comment.edit;

//import ltd.advskin.C;
//import ltd.advskin.MRAM;
//import ltd.advskin.MSKIN;
//import ltd.advskin.base.BasePage;
//import ltd.advskin.base.KcListHolder;
//import ltd.advskin.base.MPAGE;
//import ltd.advskin.utils.AdvView;
//import ltd.advskin.view.KcBtnUnion;
//import ltd.followkba.MAPP;
//import ltd.followkba.R;
//import main.MAPI;
//
//import static ltd.advskin.MSKIN.MSTRING;
//import static ltd.advskin.MSKIN.MTOAST;
//import static ltd.advskin.utils.AdvBitmap.*;
//
//public class TabTemp {
//    public void MLOG(String text) {
//        MSTRING(MAPI.GET_LOG_NAME(this) + text);
//    }
//
//    public void startTabPage(){
//        byte lastTab = 1;//2;//1;                           // 可以修改打开的Tab
//        MAPP.gClickPage = lastTab;                   // 记忆之中读取出来
//        MAPP.gLastPage = lastTab;                    // 两个相同第一次不再新建
//        BasePage basePage = getNewPage(lastTab);
//        basePage.gStyle = MPAGE.PAGE_MAIN_TAB | 1;
//        MPAGE.startBasePage(basePage);
////        MLOG(String.format("PageActivity onCreate B %s", MPAGE.getBasePageTips()));
//        MAPP.gSystemType = -1;
//    }
//
//    public void onInitView(BasePage basePage){
////        basePage.setLayout(R.layout.activity_main_a, R.layout.activity_main_1, R.layout.activity_main_2);
////        MAPP.mViewGroup = basePage.findViewById(R.id.mViewGroup);
////        Activity activity = basePage.getActivity();
////        MAPP.setMainTab(basePage);
////        KcListView kcListView;
////        MAPP.kbtTitleMain = basePage.findViewById(R.id.kbtTitleMain);
////        MAPP.kbtTitleMain.setVisibility(VISIBLE);
////        MLOG("onInitViewAA1 "+basePage);
////        if (basePage instanceof TabOwnerPage){  // “我的”页面
////            TabOwnerPage tabOwnerPage = (TabOwnerPage) basePage;
////            kcListView = new KcListView(activity, null);
////            MAPP.mViewGroup.addView(kcListView);
////            tabOwnerPage.initListView(kcListView);
////            MSKIN.setText(MSKIN.getString(R.string.page_owner), MAPP.kbtTitleMain);
////            tabOwnerPage.gItemRight = new int[MSKIN.getStringArray(R.array.owner_fragment_left_text).length];
////            return;
////        }
////        makeArrayType(basePage);
////        if (basePage instanceof TabTaskPage){   // “增粉任务”页面
////            MAPP.kbtTitleMain.setVisibility(GONE);
////            TabTaskPage tabTaskPage = (TabTaskPage) basePage;
////            tabTaskPage.tlTabMainActivity = (TabLayout) tabTaskPage.findViewById(R.id.tlTabMainActivity);
////            tabTaskPage.tlTabMainActivity.setVisibility(VISIBLE);     // 顶部选择项
////            View layout = activity.getLayoutInflater().inflate(R.layout.page_tab_task, null);
////            tabTaskPage.mLayout = layout;
////            MAPP.mViewGroup.addView(layout);
////            tabTaskPage.mWorksType = RunUtils.makeArrayType(MSKIN.getStringArray(R.array.task_works_type));
////            tabTaskPage.gTabSelect = (byte) MSKIN.getMemoryInt(W.IncFans_gTabSelect);
////            tabTaskPage.kbiTypeTask = layout.findViewById(R.id.kbiTypeTask);
////            tabTaskPage.tvNameTask = layout.findViewById(R.id.tvNameTask);
////            tabTaskPage.tvAddTask = layout.findViewById(R.id.tvAddTask);
////            tabTaskPage.kbiTypeTask.setOnClickListener(tabTaskPage.mClickListener);
////            tabTaskPage.tvNameTask.setOnClickListener(tabTaskPage.mClickListener);
////            tabTaskPage.tvAddTask.setOnClickListener(tabTaskPage.mClickListener);
////            layout.findViewById(R.id.tvSetupTask).setOnClickListener(tabTaskPage.mClickListener);
////            return;
////        }
////        if (basePage instanceof TabOperatePage){   // “人工操作”页面
////            TabOperatePage tabOperatePage = (TabOperatePage) basePage;
////            MAPP.kbtTitleMain.setVisibility(VISIBLE);
////            View layout = activity.getLayoutInflater().inflate(R.layout.page_operate_layout, null);
////            tabOperatePage.page_incfans_layout = layout;
////            MAPP.mViewGroup.addView(layout);
////            MSKIN.setText(MSKIN.getString(R.string.page_title_create), MAPP.kbtTitleMain);
////
//////            tabOperatePage.kbiTypeInc = layout.findViewById(R.id.kbiTypeInc);
//////            tabOperatePage.tvNameInc = layout.findViewById(R.id.tvNameInc);
//////            tabOperatePage.tvAddInc = layout.findViewById(R.id.tvAddInc);
////
////            return;
////        }
////        if (basePage instanceof TabKuXinPage){   // “酷信”页面
////            TabKuXinPage tabKuXinPage = (TabKuXinPage) basePage;
////            kcListView = new KcListView(activity, null);
////            MAPP.mViewGroup.addView(kcListView);
////            tabKuXinPage.initListView(kcListView);
////            tabKuXinPage.tabTypeText = MSKIN.getStringArray(R.array.kuxin_msg_type);
////            tabKuXinPage.tabTypeImg = new int[] {           // AMsgType
////                    P.kuxin_system,         P.kuxin_examine,    P.kuxin_add_friend, P.kuxin_owner,
////                    P.kuxin_me_recommed,    P.kuxin_care,       P.kuxin_char,       P.kuxin_comment,
////                    P.kuxin_collect,        P.kuxin_share,       P.kuxin_gift,       P.kuxin_active_system,
////                    P.kuxin_active_nearly,  P.kuxin_dync_care,  P.kuxin_dync_recommed,  P.kuxin_dync_works,
////                    P.kuxin_be_comment,
////            };
////            tabKuXinPage.mMsg = new ABean[tabKuXinPage.tabTypeImg.length];
////            tabKuXinPage.isDbsBusy = new boolean[tabKuXinPage.tabTypeImg.length];
//////            tabKuXinPage.tabNewestQty = new int[tabKuXinPage.tabTypeImg.length];
////            if (mMyUtils.checkIsLogin()) {
////                MSKIN.setText(MSKIN.getString(R.string.page_kuxin_title), MAPP.kbtTitleMain);
////            }else {
////                MSKIN.setText(MSKIN.getString(R.string.page_kuxin_not_login), MAPP.kbtTitleMain);
////            }
////            return;
////        }
////        if (basePage instanceof TabFriendPage){   // “朋友”页面
////            TabFriendPage tabFriendPage = (TabFriendPage) basePage;
////            MAPP.kbtTitleMain.setVisibility(VISIBLE);
////            View view = activity.getLayoutInflater().inflate(R.layout.page_friend_layout, null);
////            tabFriendPage.page_friend_layout = view;
////            MAPP.mViewGroup.addView(view);
////
////
////            tabFriendPage.isChineseDone = new boolean[3];   // 3表示有3个需要变的
////            tabFriendPage.mAPinYinArray = new List[3];   // 3表示有3个列表
////
////            tabFriendPage.mWorksList = new List[3];   // 3表示有3个列表
////            tabFriendPage.mWorksList[0] = new ArrayList<>();
////            tabFriendPage.mWorksList[1] = new ArrayList<>();
////            tabFriendPage.mWorksList[2] = new ArrayList<>();
////            MLOG(String.format("ltd.followkba.comment.edit.TabTemp fetchUserRelationsList BB-AA"));
////
////            tabFriendPage.gCirclePosition = new int[3];
////            tabFriendPage.isCircle = new boolean[3];
////            checkCircle(false, tabFriendPage);
////            tabFriendPage.gItemRight = new int [MSKIN.getStringArray(R.array.page_friend_line_text).length];
////            if (mMyUtils.checkIsLogin()) {
////                MSKIN.setText(MSKIN.getString(R.string.page_friend_title), MAPP.kbtTitleMain);
////            }else {
////                MSKIN.setText(MSKIN.getString(R.string.page_friend_not_login), MAPP.kbtTitleMain);
////            }
////            return;
////        }
//    }
//    public void onFinish(BasePage basePage){
//        MAPP.mViewGroup.removeAllViews();
//        if (basePage instanceof TabTaskPage) {
//            TabTaskPage tabTaskPage = (TabTaskPage) basePage;
//            tabTaskPage.tlTabMainActivity.setVisibility(View.GONE);     // 顶部选择项
//            return;
//        }
//        MAPP.kbtTitleMain.setVisibility(View.GONE);
//    }
//    public void onPageUpdate(BasePage basePage){
////        makeArrayType(basePage);
////        if (basePage instanceof TabOwnerPage){   // “我的”页面
////            TabOwnerPage tabOwnerPage = (TabOwnerPage) basePage;
////            if (mMyUtils.checkIsLogin()) {
////                AUserBase aUserBase = MSKIN.getCurrentAUserBase();
////                MSKIN.setText(MSKIN.getString(R.string.owner_account), MAPP.kbtTitleMain);
////                MSKIN.showUserHead(AUserFileType.IMG_SMALL, aUserBase, tabOwnerPage.kbiHeadPageOwner);
////                MSKIN.showNickName(aUserBase, tabOwnerPage.kbtNickNameOwner);
////                MSKIN.setText(String.format("KCID %d", aUserBase.UserID), tabOwnerPage.kbtKcidOwner);
////                MSKIN.setBitmap(C.qr_code, tabOwnerPage.kbiQRCodeOwner);
////            } else {
////                if (tabOwnerPage.kbiHeadPageOwner != null) {
////                    tabOwnerPage.kbiHeadPageOwner.setBackground(C3_BGC_TYPE1 | C3_BG_FOCOUS | 10, 0, 128, 128);
////                }
////                MSKIN.setBitmap(C3_BG_FOCOUS | C3_FG_NORMAL | 5, C.user_head, tabOwnerPage.kbiHeadPageOwner);
////                MSKIN.setText(MSKIN.getString(R.string.owner_account_not_login), MAPP.kbtTitleMain);
////                MSKIN.setText(MSKIN.getString(R.string.not_login_click_enter_login), tabOwnerPage.kbtNickNameOwner);
////                MSKIN.setText(MSKIN.getString(R.string.enjoy_wonderful_moments), tabOwnerPage.kbtKcidOwner);
////            }
////            tabOwnerPage.mFileRelations = new ArrayList<>();
////            tabOwnerPage.setSize(tabOwnerPage.gItemRight.length);
////            int total1 = 0;  // 没有接收到数据时显示0
////            int total2 = 0;  // 没有接收到数据时显示0
////            int length = MOBBW.getWorksSize();
////            for (int counter = 0; counter < length; counter++) {
////                AWorksType aWorksType = MOBBW.getWorksType(counter);
////                total1 += MSKIN.getDbsSize(VARIA.DBS_LOCAL_RECORD, aWorksType.getType());  // 本地录音数量
////                total2 += MSKIN.getDbsSize(VARIA.DBS_WORKS_HISTORY, aWorksType.getType()); // 播放历史数量
////            }
////            tabOwnerPage.gItemRight[0] = total1;  // 本地录音数量
////            tabOwnerPage.gItemRight[2] = total2;  // 播放历史数量
////            tabOwnerPage.gItemRight[3] = MSKIN.getDbsSize(VARIA.DBS_WORKS_UPLOAD,0);  // 发布作品草稿箱数量
////            tabOwnerPage.gItemRight[4] = -1;
////            tabOwnerPage.gItemRight[5] = -1;
////            tabOwnerPage.gItemRight[6] = -1;
////            tabOwnerPage.gItemRight[7] = -1;
////            MSKIN.setBitmap(C.qr_code, tabOwnerPage.kbiQRCodeOwner);  // 二维码图片
////
////            return;
////        }
////        if (basePage instanceof TabTaskPage){   // “增粉任务”页面
//////            TabTaskPage tabRankPage = (TabTaskPage) basePage;
//////            ImageView ivRecommandRank =  tabRankPage.mLayout.findViewById(R.id.ivRecommandRank);
//////            TextView tvRecommandRank =  tabRankPage.mLayout.findViewById(R.id.tvRecommandRank);
//////            if (tabRankPage.gWorksType == AWorksType.WORKS_SING_SONG){           // K歌吧
//////                int[] tabTextView = {R.id.tvContryRank, R.id.tvRecommandRank, R.id.tvNewWorks, };
//////                int mainTextColor = MSKIN.getThemeColor(R.attr.mainTextColor);
//////                int color;
//////
//////                for (int counter = 0; counter < 3; counter++){
//////                    if (counter == tabRankPage.gRankType){
//////                        color = MSKIN.getThemeColor(R.attr.selectFocousColor);
//////                        if (counter == 1) {                 // 地区榜
//////                        }
//////                    }else {
//////                        color = mainTextColor;
//////                    }
////////                    MLOG(String.format("tabRankPage.gRankType %s %08x %s", counter, color, tabRankPage.gRankType));
//////                    ((TextView) tabRankPage.mLayout.findViewById(tabTextView[counter])).setTextColor(color);
//////                    if (tabRankPage.gRankAreaData == 0){               // 还没有选择榜，随机找一个省出来
//////                        SubFunction subFunction = new SubFunction();
//////                        tabRankPage.gRankAreaData = subFunction.getRandomAreaData(true);
//////                        MSKIN.setMemoryInt(W.RankPage_gRankAraaData, tabRankPage.gRankAreaData);
//////                    }
//////                    String gsLocla_1 = mMyUtils.getAreaDataRankName(tabRankPage.gRankAreaData);
//////                    gsLocla_1 = String.format("%s%s", gsLocla_1, MSKIN.getString(R.string.rank_list));
//////                    MSKIN.setBitmap(C.inv_triangle, ivRecommandRank);
//////                    MSKIN.setText(gsLocla_1, tvRecommandRank);
//////                }
//////                ivRecommandRank.setVisibility(VISIBLE);
//////                tabRankPage.mLayout.findViewById(R.id.llContryRank).setVisibility(VISIBLE);
//////                tabRankPage.mLayout.findViewById(R.id.llNewWorks).setVisibility(VISIBLE);
//////            }else {
//////                int color = MSKIN.getThemeColor(R.attr.selectFocousColor);
//////                tvRecommandRank.setTextColor(color);
//////                String[] gpLocal_1 = MSKIN.getStringArray(R.array.works_type_rank_rank_recommand_page);
//////                MLOG("ltd.followkba.comment.edit.TabTemp onPageUpdate C "+gpLocal_1[tabRankPage.gWorksType.getType()]);
//////                MSKIN.setText(gpLocal_1[tabRankPage.gWorksType.getType()], tvRecommandRank);
//////                ivRecommandRank.setVisibility(GONE);
//////                tabRankPage.mLayout.findViewById(R.id.llContryRank).setVisibility(GONE);
//////                tabRankPage.mLayout.findViewById(R.id.llNewWorks).setVisibility(GONE);
//////            }
////            return;
////        }
////        if (basePage instanceof TabOperatePage){   // “人工操作”页面
////            TabOperatePage tabOperatePage = (TabOperatePage) basePage;
////            return;
////        }
////        if (basePage instanceof TabKuXinPage){   // “酷信”页面
////            TabKuXinPage tabKuXinPage = (TabKuXinPage) basePage;
////            return;
////        }
////        if (basePage instanceof TabFriendPage){   // “朋友”页面
////            TabFriendPage tabFriendPage = (TabFriendPage) basePage;
////            tabFriendPage.mFileRelations = new ArrayList<>();
////
////            List<APinYinArray> list = new ArrayList();
////            for(int counter = 0; counter < tabFriendPage.gItemRight.length; ++counter) {
////                list.add(new APinYinArray());
////            }
//////            tabFriendPage.setListView(tabFriendPage.gItemRight.length);
////
////            int total = 0;  // 没有接收到数据时显示0
////            int length = MOBBW.getWorksSize();
////            for (int counter = 0; counter < length; counter++) {
////                AWorksType aWorksType = MOBBW.getWorksType(counter);
////                total += MSKIN.getDbsSize(VARIA.DBS_WORKS_HISTORY, aWorksType.getType()); // 播放历史数量
////            }
////            tabFriendPage.gItemRight[3] = total;   // 朋友的播放历史数量
//////            MLOG("ltd.followkba.comment.edit.TabTemp ltd.followkba.TabFriendPage "+tabFriendPage.gItemRight[4]);
////            return;
////        }
////    }
////    public void makeArrayType(BasePage basePage){
////        if (basePage instanceof TabOwnerPage){  // “我的”页面
////            MOBBW.makeArrayType(basePage);      // 生成本页面使用的WorksType
////            MOBBW.makeNameWorksType(MSKIN.getStringArray(R.array.works_type_rank_page));
////            return;
////        }
////        if (basePage instanceof TabTaskPage){   // “榜单”页面
////            MOBBW.makeArrayType(basePage);      // 生成本页面使用的WorksType
////            MOBBW.makeNameWorksType(MSKIN.getStringArray(R.array.works_type_rank_page));
////            return;
////        }
////        if (basePage instanceof TabOperatePage){   // “创作”页面
////            MOBBW.makeArrayType(basePage);      // 生成本页面使用的WorksType
////            MOBBW.makeNameWorksType(MSKIN.getStringArray(R.array.works_type_create_page));
////            return;
////        }
////        if (basePage instanceof TabKuXinPage){   // “酷信”页面
////            return;
////        }
////        if (basePage instanceof TabFriendPage){   // “朋友”页面
////            MOBBW.makeArrayType(basePage);      // 生成本页面使用的WorksType
////            return;
////        }
//    }
//
//    public void initTopView(BasePage basePage, int tab, KcListHolder holder, View view){
////        if (basePage instanceof TabOwnerPage){      // “我的”页面
////            TabOwnerPage tabOwnerPage = (TabOwnerPage) basePage;
////            ((KcLayoutCard) view).setAspectRatio(9f / 16f);                        // 背景尺寸 16:9
////            tabOwnerPage.kbiBgTopOwner = (KcBtnImage) view.findViewById(R.id.kbiBgTopOwner);
////            tabOwnerPage.kbiBgTopOwner.setAspectRatio(9f / 16f);                        // 背景尺寸 16:9
//////            C3_TRANS6
////            // P.png 图片需要用到透明效果时，浅色的主题需要大点以保留更多的内容
//////            MLOG(String.format("C3_TRANS6 %08x %08x",MRAM.g4ThemeC3Trans, C3_TRANS6));
//////            MSKIN.setBitmap(C3_TRANS1, P.cnkc_owner_bg, tabOwnerPage.kbiBgTopOwner);  // 背景图片
////            MSKIN.setBitmap(MRAM.g4ThemeC3Trans, P.cnkc_owner_bg, tabOwnerPage.kbiBgTopOwner);  // 背景图片
////            tabOwnerPage.kbiHeadPageOwner = (KcBtnImage) view.findViewById(R.id.kbiHeadPageOwner);
////            tabOwnerPage.kbtNickNameOwner = (KcBtnText) view.findViewById(R.id.kbtNickNameOwner);
////            tabOwnerPage.kbtKcidOwner = (KcBtnText) view.findViewById(R.id.kbtKcidOwner);
////            tabOwnerPage.kbiQRCodeOwner = (KcBtnImage) view.findViewById(R.id.kbiQRCodeOwner);
////            String[] gpLocal_1 = MSKIN.getStringArray(R.array.owner_four_btn);
////            int[] tabButton = new int[]{
////                    C3_BGC_TYPE0 |  20, R.attr.colorPrimaryDark, C.smart_device,
////                    C3_BGC_TYPE0 |  20, R.attr.colorPrimaryDark, C.my_cloud_work,
////                    C3_BGC_TYPE0 | 20, R.attr.colorPrimaryDark, C.cloud_disk,
////                    C3_BGC_TYPE0 | 20, R.attr.colorPrimaryDark, C.account,
////            };
////            int color;
////            KcBtnUnion[] unions = new KcBtnUnion[gpLocal_1.length];
////            int g4Local_1;
////            for (int counter = 0; counter < gpLocal_1.length; counter++){
////                unions[counter] = new KcBtnUnion(basePage.getActivity());
////                unions[counter].isUpLowMode = true;
////                unions[counter].sizeByHeight = true;
////                unions[counter].setTextSize((short) AdvView.spToPx(12));
////                unions[counter].setFgPadding((short) AdvView.dpToPx(2));
////                unions[counter].setTextPadding((short) AdvView.spToPx(8));
////                //unions[counter].gTextColor = MSKIN.getThemeColor(R.attr.boyUserBg);
////                g4Local_1 = counter * 3;
////                color = MSKIN.getThemeColor(tabButton[g4Local_1 + 1]);
////                unions[counter].setBackground(tabButton[g4Local_1], color, 128, 128);
////                unions[counter].setBitmap(tabButton[g4Local_1 + 2]);
////                unions[counter].setText(gpLocal_1[counter]);
////            }
////            tabOwnerPage.kgaOwner.setViews(unions);
////            return;
////        }
////        if (basePage instanceof TabTaskPage) {      // “榜单”页面
//////            ltd.followkba.comment.edit.TabTaskPage tabRankPage = (ltd.followkba.comment.edit.TabTaskPage) basePage;
//////            tabRankPage.tlTabMainActivity.setVisibility(View.GONE);     // 顶部选择项
////            return;
////        }
////        if (basePage instanceof TabOperatePage) {    // “创作”页面
////            return;
////        }
////        if (basePage instanceof TabKuXinPage) {     // “酷信”页面
////            return;
////        }
////        if (basePage instanceof TabFriendPage) {    // “朋友”页面
////            return;
////        }
//    }
//
//    public void selectMainTab(boolean click){    // 底部Tab选择
////        setTabColor(MAPP.gClickPage);
////        boolean isChange = (click && MAPP.gClickPage !=  MAPP.gLastPage) ? true : false;
////        if (!click || isChange) {
////            MLOG(String.format("TempActivity selectTab C %s %s %s", click, MAPP.gClickPage, MAPP.gLastPage));
////            BasePage basePage = getNewPage(MAPP.gClickPage);
////            if (basePage != null){
////                if (basePage instanceof TabOperatePage){
////                    if (!mMyUtils.checkIsLogin()) {
////                        MTOAST("请先登录");
////                        return;
////                    }
////                }
////                basePage.gStyle = MPAGE.PAGE_MAIN_TAB | 1;
////                MPAGE.startBasePage(basePage);
////            }
////        }
////        if (click){
////            MAPP.gLastPage = MAPP.gClickPage ;
////        }
//    }
//    public BasePage getNewPage(byte number){
////        MLOG("TestCreatePageAA "+MPAGE.mPageCurrent);
////        switch (number) {
////            case 0: return new TabOwnerPage();      // “我的”页面
////            case 1: return new TabTaskPage();       // “榜单”页面
////            case 2: return new TabOperatePage();     // “创作”页面
////            case 3: return new TabKuXinPage();      // “酷信”页面
////            case 4: return new TabFriendPage();     // “朋友”页面
////        }
//        return null;
//    }
//    public void setTabColor(int tab){
//        int mainTextColor = MSKIN.getThemeColor(R.attr.mainTextColor);
//        int selectFocousColor = MSKIN.getThemeColor(R.attr.selectFocousColor);
//        int[] tabDrawable = {C.tab_owner, C.tab_rank, C.tab_create, C.tab_ku_xin, C.tab_friend,};
//        KcBtnUnion kcBtnUnion;
//        for (int counter = 0; counter < 5; counter++) {
//            kcBtnUnion = MAPP.kguMainTab.getItem(counter);
//            if (counter != tab) {                  // 本次没有选中的，普通亮度显示
//                kcBtnUnion.setBitmap(C3_FG_NORMAL, null, tabDrawable[counter]);
//                kcBtnUnion.setTextColor(mainTextColor, C3_FG_NORMAL);
//            } else {                  // 本次选中的，高亮显示
//                kcBtnUnion.setBitmap(C3_FG_FOCOUS, null, tabDrawable[counter]);
//                kcBtnUnion.setTextColor(selectFocousColor, C3_FG_FOCOUS);
//            }
//            if (counter == 3){                      // 酷信角标显示的数量
//                MLOG(String.format("TempActivity selectMainTab DD %s %s", kcBtnUnion.getRightUpMarke(), MRAM.gMsgNewestQty));
//                if (kcBtnUnion.getRightUpMarke() != MRAM.gMsgNewestQty){
//                    kcBtnUnion.setRightUpMarker(MRAM.gMsgNewestQty, AdvView.dpToPx(10), 0);
//                }
//            }
//        }
//    }
//}
